<template>
<div>
<h2 class='name' v-for='n in name' :key='251'>{{n.name}} | {{n.age}} | {{n.sex}}</h2>
<!-- 这是query参数传递方法 -->
<router-link to='/school/son2/food?food=饭'>吃饭</router-link>
<hr>
<!-- 下面是params参数传递方法,这样携带了还要去路由告诉它参数的名字 -->
<router-link to='/school/son2/food/鸡'>吃鸡</router-link>
 <router-view></router-view>
</div>
</template>

<script>
export default {
    name:'Student',
    data(){
        return {
            name:[{
                name:"张二",
                age:'17',
                sex:'男'
            }]
        }
    }
}
</script>


<style>
    .name{
        background: lightblue;
    }
</style>